using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SharedKernel.Infrastructure.Repositories;
using ProductService.Domain.Models;

namespace ProductService.Domain.Repositories
{
    /// <summary>
    /// 商品仓储接口
    /// </summary>
    public interface IProductRepository : IRepository<Product, Guid>
    {
        /// <summary>
        /// 根据名称获取商品
        /// </summary>
        /// <param name="name">商品名称</param>
        /// <returns>商品实体</returns>
        Task<Product> GetByNameAsync(string name);

        /// <summary>
        /// 根据分类获取商品列表
        /// </summary>
        /// <param name="category">商品分类</param>
        /// <returns>商品列表</returns>
        Task<List<Product>> GetByCategoryAsync(string category);

        /// <summary>
        /// 搜索商品
        /// </summary>
        /// <param name="keyword">搜索关键词</param>
        /// <returns>商品列表</returns>
        Task<List<Product>> SearchAsync(string keyword);
    }
}